﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace KM
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
           
        //    routes.MapRoute(
        //       name: "Login",
        //       url: "KmAdmin/LogIn",
        //       defaults: new { controller = "User", action = "LogIn" }
        //   );
            routes.MapRoute(
              name: "Admin Index",
              url: "REMAdmin",
              defaults: new { controller = "Home", action = "Index" },
              namespaces: new[] { "KM.Areas.Admin.Controllers" }
          );
          


        //    routes.MapRoute(
        //        name: "edit loai san pham",
        //        url: "RAdmin/LoaiSanPham/edit/{id}",
        //        defaults: new { controller = "LoaiSanPham", action = "edit", id = 0 }
        //    );

        //    routes.MapRoute(
        //    name: "Danh sach loai san pham",
        //    url: "RAdmin/LoaiSanPham",
        //    defaults: new { controller = "LoaiSanPham", action = "dsLoaiSanPham" }
        //);
        //    routes.MapRoute(
        //     name: "edit san pham",
        //     url: "RAdmin/SanPham/edit/{id}",
        //     defaults: new { controller = "SanPham", action = "edit", id = 0 }
        // );
        //    routes.MapRoute(
        //      name: "Danh sach san pham",
        //      url: "RAdmin/SanPham/{Id}",
        //      defaults: new { controller = "SanPham", action = "dssanpham",Id=0 }
        //  );
        //    routes.MapRoute(
        //       name: "Danh khuyen mai",
        //       url: "KmAdmin/DanhSach",
        //       defaults: new { controller = "KhuyenMai", action = "Danhsach" }
        //   );

        //    routes.MapRoute(
        //       name: "Create Khuyen Mai",
        //       url: "KmAdmin/LayKhuyenMai",
        //       defaults: new { controller = "KhuyenMai", action = "LayKhuyenMai" }
        //   );

        //    routes.MapRoute(
        //        name: "Khuyen mai",
        //        url: "KmAdmin/",
        //        defaults: new { controller = "KhuyenMai", action = "Index" }
        //    );

            //rem

            routes.MapRoute(
                name: "Danhmuc",
                url: "DanhMuc/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "KM.Areas.REM.Controllers" }
            ).DataTokens.Add("Area", "REM");

            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}/{id}",
            //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            //    namespaces: new[] { "KM.Areas.REM.Controllers" }
            //).DataTokens.Add("Area", "REM");

        }
    }
}